Two Algorithms for Locating Ancestors of a Large Set of Vertices in a Tree
نویسندگان
چکیده
Abstract: A lot of tree-shaped data exists: XML documents, abstract syntax trees, hierarchies, etc. To accelerate query processing on trees stored in a relational database a pre-post-ordering can be used. It works well for locating ancestors of a single or few vertices because pre-post-ordering avoids recursive table access. However, it is slow if it comes to locating ancestors of hundreds or thousands of vertices because ancestors of each of the input vertices are located sequentially. In this paper, two novel algorithms (sort-tilt-scan and single-passscan) for solving this problem are proposed and compared with a naı̈ve approach. While the sort-tilt-scan improves the performance by a constant factor, the single-pass-scan achieves a better complexity class. The performance gain is achieved because of a single table scan which can locate all result vertices by a single run. Using generated data, this paper demonstrates that the single-pass-scan is orders of magnitude faster than the naı̈ve approach.
منابع مشابه
The 2-dimension of a Tree
Let $x$ and $y$ be two distinct vertices in a connected graph $G$. The $x,y$-location of a vertex $w$ is the ordered pair of distances from $w$ to $x$ and $y$, that is, the ordered pair $(d(x,w), d(y,w))$. A set of vertices $W$ in $G$ is $x,y$-located if any two vertices in $W$ have distinct $x,y$-location.A set $W$ of vertices in $G$ is 2-located if it is $x,y$-located, for some distinct...
متن کاملالگوریتم های بهینه برای مدل های مکانیابی 2- مرکز ناخوشایند پشتیبان روی گراف های درختی
In this paper, we investigate the backup undesirable -center location models on tree graphs. The aim is to obtain the best locations on the vertex set of the underlying tree for establishing two undesirable servers so that the expected value of the closest distance from the existing customers to the functioning facilities is maximized under the assumption that any facility may fail with a given...
متن کاملConstructing Graceful Graphs with Caterpillars
A graceful labeling of a graph G of size n is an injective assignment of integers from {0, 1,..., n} to the vertices of G, such that when each edge of G has assigned a weight, given by the absolute dierence of the labels of its end vertices, the set of weights is {1, 2,..., n}. If a graceful labeling f of a bipartite graph G assigns the smaller labels to one of the two stable sets of G, then f ...
متن کاملHow to Infer Ancestral Genome Features by Parsimony: Dynamic Programming over an Evolutionary Tree
We review mathematical and algorithmic problems of reconstructing evolutionary features at ancestors in a known phylogeny. In particular, we revisit a generic framework for the problem that was introduced by Sankoff and Rousseau [“Locating the vertices of a Steiner tree in an arbitrary metric space,” Mathematical Programming, 9:240–246, 1975].
متن کاملتعبیه ی هندسی درخت درنقاط داخل یک چندضلعی با حداقل تعداد خم
In this paper we consider to embed a tree T with N vertices on a set of N points inside a simple polygon on n vertices and the goal is to minimize the number of bends. The main idea of our algorithm is modeling the problem into graph matching problem and uses the graph matching algorithms. We apply the concept of error-correction transformation and find the appropriate cost function then we per...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2011